{% extends "EMNewsBundle::layout.html.twig" %}
{% block title 'News - News List ' %}
{% block middlenav%}
<div class="middleNav">
    	<ul>
        	<li class="iNew"><a href="{{ path('em_news') }}" title=""><span>Add New</span></a></li>
		</ul>
    </div>
{% endblock%}

{% block content %}
   <div class="title"><h5>Current Status  </h5></div>
    <!-- Dynamic table -->
        <div class="table">
            <div class="head"><h5 class="iFrames">My News</h5></div>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                <thead>
                    <tr>
                        <th>ccc</th>
                        <th>Source</th>
                        <th>Lang</th>
                        <th>Status  </th>
                        <th>Country  </th>
                        <th>Actions  </th>
                        <th>Status </th>
                    </tr>
                </thead>
                <tbody>
                   
                    {% for new in news %}
			
                        
                         
                         {% for nrel in newsrel %}
                           
                        {%if new.id==nrel.neworiginal.id%}
                        <tr class="gradeA">
                         <td class="center">{{new.title}}</td>
                         <td class="center"><a href="{{new.url}}" target="_blank">{{new.source.name}}</a></td>
                         <td class="center">{{new.language.name}}</td>
                         <td class="center">{{nrel.neworiginal.status}}{%if nrel.newtranslated.status is defined%} , {{nrel.newtranslated.status}}{%endif%}</td>
                         <td class="center">{{new.geography.name}}</td>
                         <td class="center">
                             <a href="{{ path('em_news_edit', {'id':new.id}) }}" id="edit" >
                             <img src="{{asset('bundles/news/images/icons/color/pencil.png')}}" alt="" title="Edit text"></a> 
                    &nbsp; | <a href="{{ path('em_news_edit', {'id':nrel.newtranslated.id}) }}" id="edit" ><img src="{{asset('bundles/news/images/icons/color/selection-input.png')}}" alt="" title="Edit english version"></a>
                         </td>
                         <td class="center">
                             {%if nrel.newtranslated is null%}
                             <a href="{{ path('em_news_2edit', {'idNew':new.id}) }}"><img src="{{asset('bundles/news/images/icons/color/exclamation.png')}}" alt="" title="Not associated"></a> &nbsp;</td>
                             {%else%}
                             <img src="{{asset('bundles/news/images/icons/color/tick.png')}}" alt="" title="Done"> &nbsp;</td>
                             {% endif %}
                         </tr>
                         {% endif %}
                       
		   {% endfor %}
                         
		   {% endfor %}
                </tbody>
            </table>
              
	</div>    
        
{% endblock %}
